import service from '@/utils/request'

export function login(parameter) {
    return service({
      url: '/sys/login',
      method: 'post',
      data: parameter,
    })
}

export function wxAuthlogin(authParam) {
    return service({
      url: `/thirdLogin/wxAuthLogin?code=${authParam.code}&state=${authParam.state}`,
      method: 'get',
    })
}

export function logout(logoutToken) {
  return service({
    url: '/sys/logout',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
      'X-Access-Token': logoutToken,
    },
  })
}

// 通过token获取用户信息
export function GetUserInfoByTokenReq(token) {
  return service({
    url: `/sys/user/currentUser?token=${token}`,
    method: 'get',
  })
}